package cn.edu.nju.software.zp13.assignment5.service.soapMessage;

import java.util.Locale;

import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFault;

public class IllegalQueryConditionSOAPMsgProducer extends SOAPMsgProducer{

	@Override
	public void processSOAPMsg() {
		try {
			SOAPEnvelope envelope=this.soapMessage.getSOAPPart().getEnvelope();
			SOAPBody body=envelope.getBody();
			SOAPFault fault=body.addFault();
			fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
			fault.addFaultReasonText("illegal query condition", Locale.US);
		} catch (SOAPException e) {
			e.printStackTrace();
		}
	}

}
